Problem: Evaluate $~~\int^1_{1/2} x\cos(\pi x)dx\,$. Choose 1 answer: Choose 1 answer: (Choice A) A $-\dfrac3{2\pi}$ (Choice B) B $-\dfrac1{2\pi}$ (Choice C) C $ \dfrac1{2\pi}+\dfrac1{\pi^2}$ (Choice D) D $ -\dfrac1{2\pi}-\dfrac1{\pi^2}$ (Choice E) E $ -\dfrac1{2\pi}+\dfrac1{\pi^2}$
Explanation: We will solve this by integrating by parts. We know that $ \int u(x)v\,^\prime(x)dx = u(x)v(x)-\int u\,^\prime(x)v(x)dx\,$. We can rewrite this as $ \int u\ dv = uv-\int v\ du\,$. In this problem we will let $~u = x~$ and $~dv=\cos(\pi x) dx\,$. Then $~du = dx~$ and $~ v =\int\cos(\pi x)\,dx= \dfrac{\sin(\pi x)}\pi\,$. Integration by parts gives $ \int^1_{1/2} x\cos(\pi x)\ dx = \dfrac{x\sin(\pi x)}{\pi}\Bigg]^1_{1/2}-\int^1_{1/2}\dfrac{\sin(\pi x)}{\pi}\,dx$ $ ~= \dfrac{x\sin(\pi x)}{\pi}-\frac1\pi \Big(-\dfrac{\cos(\pi x)}{\pi}\Big)\Bigg]^1_{1/2}$ $ ~= \dfrac{x\sin(\pi x)}{\pi}+\dfrac{\cos(\pi x)}{\pi^2}\Bigg]^1_{1/2} $ $ ~= \Big(0-\dfrac{1}{\pi^2}\Big)-\Big(\dfrac1{2\pi}+0\Big)=- \dfrac1{2\pi}-\dfrac1{\pi^2}\,$.